Skip to content

Conversation

@ocavue
Copy link
Contributor

@ocavue ocavue commented Jun 18, 2025

When working on typedoc-plugin-markdown, I found that the members function accepts an undefined model argument during runtime, while the TS types say model must be an array.

After some debugging, I found the reason. model.children here is DeclarationReflection[] | undefined, but it's forced to be asserted as DeclarationReflection[].

I found that type assertions are relatively evaluated and should be avoided if we can. This PR removes some build-time type assertions and replaces them with runtime types.

@vercel
Copy link

vercel bot commented Jun 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
typedoc-plugin-markdown ⬜️ Ignored (Inspect) Visit Preview Jun 18, 2025 7:49pm

@tgreyuk tgreyuk merged commit b53ca35 into typedoc2md:main Jun 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants